home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
326-350
/
disk_347
/
cursor
/
example.bas
< prev
next >
Wrap
BASIC Source File
|
1992-05-06
|
432b
|
22 lines
'
' This program prints the prime-numbers from 2 to 1000 to the screen.
' The compiled program needs 21 seconds (16 seconds without PRINT-command),
' with AmigaBASIC it takes about 226 (212) seconds on my Amiga 500
'
DEFINT a-z
BeginTime& = TIMER
FOR a = 2 TO 1000
FOR b = 3 TO a-1
IF b*INT(a\b) = a THEN NotPrim
NEXT b
PRINT a
NotPrim:
NEXT a
PRINT "Time needed:";TIMER-BeginTime&
WHILE INKEY$ = "" : WEND